package beans;

import java.util.List;

import javax.faces.model.DataModel;

import daos.DAOturma;
import entidades.Turma;

public class MBturma {
	
	private Turma beanTurma;
	private DAOturma daoTurma;
	@SuppressWarnings("rawtypes")
	private DataModel listaTurma;
	
	public MBturma (){
		beanTurma = new Turma();
		daoTurma = new DAOturma();	
	}

	public String prepararAdicionar(){
		beanTurma = new Turma();
		return "adicionarturma";
	}
	
	public String adicionar(){
		daoTurma.salvar(beanTurma);
		return "Turma";
	}
	
	public List<Turma> getListarMenu(){
		return daoTurma.listar();
	}

	public Turma getBeanTurma() {
		return beanTurma;
	}

	public void setBeanTurma(Turma beanTurma) {
		this.beanTurma = beanTurma;
	}

	public DAOturma getDaoTurma() {
		return daoTurma;
	}

	public void setDaoTurma(DAOturma daoTurma) {
		this.daoTurma = daoTurma;
	}

	@SuppressWarnings("rawtypes")
	public DataModel getListaTurma() {
		return listaTurma;
	}

	@SuppressWarnings("rawtypes")
	public void setListaTurma(DataModel listaTurma) {
		this.listaTurma = listaTurma;
	}

}
